<?php
namespace app\admin\validate;

use think\Validate;

class Goods extends Validate
{
    protected $rule = [
        'goods_name'  =>  'require|unique:tp_goods',//必须跟上数据库名
        'category_id'   => 'require',
        'market_price' => 'require',    
        'shop_price' => 'require',    
        'goods_weight' => 'require',  

    ];


    protected $message  =   [
        'goods_name.require' => '商品名称必须',
        'goods_name.unique'     => '商品名称不能重复',
        'category_id.require'   => '商品所属栏目不能为空！',
        'market_price.require'  => '商品市场价格不能为空！',
        'shop_price.require'  => '商品本店价格不能为空！',
        'goods_weight.require'=>'商品重量不能为空！',
    ];

}